<template>
  <div class="home">
    <div class="wrap banner">
      <img src="../assets/img/banner.f559b49d.png" alt="" />
    </div>

    <!-- 商品展示区 -->
    <div class="content">
      <!-- 精品推荐区 -->
      <div class="wrap recommend">
        <!-- 头部 -->
        <div class="recommend-header">
          <p class="title">
            <span><img src="../assets/img/jingpin.png" alt="" /></span>

            <span>精品推荐</span>
          </p>
          <p class="more">
            <span>更多</span>
            <img src="../assets/img/arrow.png" alt="" />
          </p>
        </div>
        <!-- 精品商品列表 -->
        <Integral :data="arr" />
      </div>

      <!-- 热门兑换区 -->
      <Hot />
    </div>
  </div>
</template>

<script>
// 导入精品推荐api
import { recommendAPI } from "@/request/api";
import Integral from "../goods/Integral.vue";
import Hot from "../goods/Hot.vue";

export default {
  name: "HomeView",
  components: { Integral, Hot },
  data() {
    return {
      arr: [],
    };
  },
  async created() {
    let res = await recommendAPI();
    this.arr = res.data.data.records;
    console.log("11111", res, res.data.data.records);
  },
};
</script>

<style lang="less" scoped>
.content {
  background-color: #f5f5f5;
  margin-top: 30px;

  .recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0 20px;
    .title {
      img {
        width: 40px;
        height: 36px;
      }
      span {
        width: 119px;
        height: 36px;
        font-size: 30px;
        font-family: SourceHanSansSC;
        font-weight: bold;
        color: #242b39;
        line-height: 23px;
        padding-left: 10px;
        vertical-align: middle;
      }
    }
    .more {
      cursor: pointer;
      span {
        padding-right: 6px;
        vertical-align: middle;
      }
      img {
        width: 14px;
        height: 14px;
        vertical-align: middle;
      }
    }
  }
}
</style>
